<?php
class frm_getAllGames{
	private $args;
	function __construct($arg){
		$this->args = $arg;
	}
	function getPublish(){
		$appid = DataGameManager::getAppID();
		{ $ptnmng  = new Util\str\PatternManager( $_SESSION[ "service_dir" ]  .'/../Application/' .FunctionApp::getAppDirectory(   $appid   ).'/' .'pattern/' . ('ptn_'.  'frm_getAllGames'  ) .'.php'  );} ;
		$ptnmng->gamebutton->appid = $appid;
		$ptnmng->main->appid = $appid;
		$games = FunctionGameCenter::getAllGames();
		$id = 1;
		if(is_array($games)){
			foreach($games as $game){
				$ptnmng->gamebutton->gameid = $id;
				$ptnmng->gamebutton->title = $game->getName();
				$ptnmng->gamebutton->description = $game->getInfomation();
				$ptnmng->main->listgames .=  $ptnmng->gamebutton ->publish() ;
				$id++;
			}
		}
		return  $ptnmng->main ->publish() ;
	}
}
?>